﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.Master" AutoEventWireup="true" CodeBehind="BGM_Project_Approve.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.BGM_Project_Approve" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<%@ Register src="../Controls/Panel/UserPanel.ascx" tagname="UserPanel" tagprefix="uc3" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<Link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css">

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None"  > 
</telerik:RadAjaxLoadingPanel>

<telerik:RadAjaxManager runat="server" ID="RadManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnAddNew">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnDetail" LoadingPanelID="RadAjaxLoadingPanel1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="pnDetail">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnDetail" LoadingPanelID="RadAjaxLoadingPanel1"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<table style="width: 985px; height: 100%;">
    <tr>
    <%--<td width="274px" valign="top">
        <uc3:UserPanel ID="UserCtrl" runat="server" />
    </td>--%>
    <td valign="top">
        <div class="Background710">
            <div class="BackgroundBottom710">
                Test
            </div>
        </div>  
    </td>
    </tr>
    <tr>
    <td valign = "top" colspan="2">
        <div class="Background980">
            <div class="BackgroundBottom980">
                <asp:Panel ID="panelList" runat="server" Height="360px" ScrollBars="Auto">
                    <table width="100%">
                        <tr>
                            <td align="center" colspan="2">
                                <br />
                                <table width="95%">
                                    <tr>
                                        <td  align="left" valign="top" bgcolor="#7DA5E0" 
                                            style="padding: 5px; color: #FFFFFF; font-weight: bold;">
                                            ขั้นตอนที่ 1 : เลือกประเภทของการทำงาน
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" width="36%">
                                <br />
                                ประเภทของการทำงาน :
                            </td>
                            <td align="left">
                                <br />
                                &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<telerik:RadComboBox ID="cbProcess" runat="server" Width="350">
                                <Items>
                                    <telerik:RadComboBoxItem Value="RQ" Text="เสนอขออนุมัติงาน/โครงการ" />
                                    <telerik:RadComboBoxItem Value="AP" Text="แจ้งความประสงค์ขอแก้ไขข้อมูลงาน/โครงการ" />
                                </Items>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2">
                                <br />
                                <table width="95%">
                                    <tr>
                                        <td align="left" valign="top" bgcolor="#7DA5E0" 
                                            style="padding: 5px; color: #FFFFFF; font-weight: bold;">
                                            ขั้นตอนที่ 2 : เลือกงาน/โครงการที่ต้องการดำเนินการจากตาราง 
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <table width="95%">
                                    <tr valign="top">
                                        <td align="center">
                                            <br />
                                            <asp:RadioButtonList ID="rdoModeRD_t1" runat="server" AutoPostBack="True" 
                                                onselectedindexchanged="rdoModeRD_t1_SelectedIndexChanged" 
                                                Font-Names="Segoe UI" Font-Size="13px"
                                                RepeatDirection="Horizontal">
                                                <asp:ListItem Selected="True" Value="1">
                                                    จัดกลุ่มตามกิจกรรมย่อย
                                                </asp:ListItem>
                                                <asp:ListItem Value="2">
                                                    จัดกลุ่มตามหน่วยงาน
                                                </asp:ListItem>
                                            </asp:RadioButtonList>
                                            <asp:Label ID="lblHeaderID" runat="server" Visible="False"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <br />


                                                <asp:Panel ID="panelGrid_t1" runat="server" ScrollBars="Auto" Width="95%">
                                                   
                                                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="Grid_t1" runat="server" AllowFilteringByColumn="True" 
                                                        AllowPaging="True" AutoGenerateColumns="False" 
                                                        GridLines="None" MasterTableView-GridLines="None" 
                                                        AllowMultiRowSelection="true"
                                                        OnItemCommand="Grid_t1_ItemCommand" onitemdatabound="Grid_t1_ItemDataBound" 
                                                        Width="98%">
                                                        <mastertableview commanditemdisplay="None" datakeynames="Sequence" grouploadmode="Client" width="100%">
                                                            <nestedviewtemplate>
                                                                <asp:Panel ID="PanelNested_t1" runat="server" BackColor="#FFFFCC" Width="100%"><br />
                                                                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="GridIn_t1" 
                                                                        runat="server" 
                                                                        AllowPaging="True" 
                                                                        AutoGenerateColumns="False" 
                                                                        GridLines="None" 
                                                                         
                                                                        Width="100%">
                                                                            <mastertableview cellspacing="-1">
                                                                                <rowindicatorcolumn>
                                                                                <HeaderStyle Width="20px" />
                                                                            </rowindicatorcolumn>
                                                                            <expandcollapsecolumn>
                                                                                <HeaderStyle Width="20px" />
                                                                            </expandcollapsecolumn>
                                                                                <Columns>
                                                                                    <telerik:GridBoundColumn 
                                                                                        DataField="bgm_source_name" 
                                                                                        HeaderStyle-HorizontalAlign="Center" 
                                                                                        HeaderText="แหล่งเงิน" 
                                                                                        ItemStyle-HorizontalAlign="Left" 
                                                                                        UniqueName="bgm_source_name" 
                                                                                        Visible="true">
                                                                                        <HeaderStyle HorizontalAlign="Center" />
                                                                                        <ItemStyle HorizontalAlign="Left" />
                                                                                     </telerik:GridBoundColumn>
                                                                                     
                                                                                     <%--<telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                                        CurrentFilterFunction="Contains" DataField="pre_total_amount" 
                                                                                        DataFormatString="{0:#,##0.00}" FilterControlWidth="100%" 
                                                                                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="70px" 
                                                                                        HeaderText="วงเงินก่อนพิจรณา" ItemStyle-HorizontalAlign="Right" 
                                                                                        ShowFilterIcon="false" UniqueName="pre_total_amount" Visible="true"><HeaderStyle HorizontalAlign="Center" /><ItemStyle HorizontalAlign="Right" />
                                                                                     </telerik:GridBoundColumn>--%>
                                                                                     
                                                                                     <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                                        CurrentFilterFunction="Contains" DataField="total_amount" 
                                                                                        DataFormatString="{0:#,##0.00}" FilterControlWidth="100%" 
                                                                                        HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="150px" 
                                                                                        HeaderText="วงเงิน(บาท)" ItemStyle-HorizontalAlign="Right" 
                                                                                        ShowFilterIcon="false" UniqueName="total_amount" Visible="true"><HeaderStyle HorizontalAlign="Center" /><ItemStyle HorizontalAlign="Right" />
                                                                                     </telerik:GridBoundColumn>
                                                                                        
                                                                                  </Columns>
                                                                              </mastertableview>
                                                                        </telerik:RadGrid>
                                                                    <br />
                                                                 </asp:Panel>
                                                            </nestedviewtemplate>
                                                        <Columns>
                                                            <telerik:GridClientSelectColumn HeaderStyle-HorizontalAlign="Center" 
                                                                HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center" 
                                                                UniqueName="ClientSelectColumn">
                                                                <HeaderStyle HorizontalAlign="Center" Width="30px" />
                                                                <ItemStyle HorizontalAlign="Center" />
                                                            </telerik:GridClientSelectColumn>
                                                            
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                CurrentFilterFunction="Contains" DataField="bgm_prj_name" FilterControlWidth="100%" 
                                                                HeaderStyle-HorizontalAlign="Center" HeaderText="งาน/โครงการ"
                                                                ShowFilterIcon="false" UniqueName="bgm_prj_name"><HeaderStyle 
                                                                HorizontalAlign="Center" Width="50%" />
                                                                <ItemStyle HorizontalAlign="left" />
                                                            </telerik:GridBoundColumn>
                                                            
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                CurrentFilterFunction="Contains" DataField="Strategy" FilterControlWidth="100%" 
                                                                HeaderStyle-HorizontalAlign="Center" HeaderText="กิจกรรมย่อย" 
                                                                ShowFilterIcon="false" UniqueName="Strategy"><HeaderStyle 
                                                                HorizontalAlign="Center" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                CurrentFilterFunction="Contains" DataField="job_site_name" 
                                                                FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                                                HeaderText="หน่วยงาน" ItemStyle-HorizontalAlign="Left" ShowFilterIcon="false" 
                                                                UniqueName="job_site_name" Visible="true">
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Left" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                CurrentFilterFunction="Contains" DataField="full_name" 
                                                                FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                                                HeaderText="ผู้รับผิดชอบ" ItemStyle-HorizontalAlign="Left" 
                                                                ShowFilterIcon="false" UniqueName="full_name" Visible="false">
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Left" />
                                                            </telerik:GridBoundColumn>
<%--                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                CurrentFilterFunction="Contains" DataField="pre_total_amount" 
                                                                DataFormatString="{0:#,##0.00}" FilterControlWidth="100%" 
                                                                HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="70px" 
                                                                HeaderText="จำนวนเงินก่อนพิจรณา" ItemStyle-HorizontalAlign="Right" 
                                                                ShowFilterIcon="false" UniqueName="pre_total_amount" Visible="true">
                                                                <HeaderStyle HorizontalAlign="Center" Width="200px" />
                                                                <ItemStyle HorizontalAlign="Right" />
                                                            </telerik:GridBoundColumn>--%>
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                CurrentFilterFunction="Contains" DataField="total_amount" 
                                                                DataFormatString="{0:#,##0.00}" FilterControlWidth="100%" 
                                                                HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="150px" 
                                                                HeaderText="วงเงิน(บาท)" ItemStyle-HorizontalAlign="Right" 
                                                                ShowFilterIcon="false" UniqueName="total_amount" Visible="true">
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Right" />
                                                            </telerik:GridBoundColumn>
                                                            
                                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                                CurrentFilterFunction="Contains" DataField="record_status" 
                                                                ItemStyle-HorizontalAlign="Left" ShowFilterIcon="false" 
                                                                UniqueName="record_status" Visible="false">
                                                                <HeaderStyle HorizontalAlign="Center" />
                                                                <ItemStyle HorizontalAlign="Left" />
                                                            </telerik:GridBoundColumn>
                                                            
                                                        </Columns>
                                                        </mastertableview>
                                                    <clientsettings enablerowhoverstyle="true">
                                                        <clientevents /><selecting allowrowselect="True" /></clientsettings>
                                                    <PagerStyle Mode="NextPrevAndNumeric" />
                                                </telerik:RadGrid>
                                                
                                                    
                                                </asp:Panel>
                                            
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center" style="padding-top: 5px">
                                <br />
                                <table width="95%">
                                    <tr>
                                        <td align="left" valign="top" bgcolor="#7DA5E0" 
                                            style="padding: 5px; color: #FFFFFF; font-weight: bold;">
                                            ขั้นตอนที่ 3 : กำหนดลำดับชั้นในการเสนอขออนุมัติงาน/โครงการ 
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <br />
                                <asp:Panel ID="pnDetail" runat="server">
                                <asp:Label ID="lbCountRow" runat="server" Visible="false" Text="1"></asp:Label>
                                    <asp:Table ID="tb" runat="server" Width="85%">
                                        <asp:TableRow>
                                            <asp:TableHeaderCell Width="20%" Height="30px">
                                                ลำดับที่
                                            </asp:TableHeaderCell>
                                            <asp:TableHeaderCell HorizontalAlign="center">
                                                ตำแหน่งทางการบริหาร
                                            </asp:TableHeaderCell>
                                            <asp:TableHeaderCell Width="40%">
                                                ความคิดเห็น/ข้อเสนอแนะ
                                            </asp:TableHeaderCell>
                                            <asp:TableHeaderCell Width="5%">
                                                
                                            </asp:TableHeaderCell>
                                        </asp:TableRow>
                                    </asp:Table>
                                    <table width="77%">
                                        <tr>
                                            <td align="right" style="padding-top: 10px; padding-bottom: 15px;">
                                                <asp:LinkButton ID="btnAddNew" runat="server" onclick="btnAddNew_Click">เพิ่มลำดับชั้นในการอนุมัติเอกสาร</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center" style="padding-top: 5px">
                                <table width = "95%">
                                    <tr>
                                        <td colspan="4" align="left" valign="top" bgcolor="#7DA5E0" 
                                            style="padding: 5px; color: #FFFFFF; font-weight: bold;">
                                            ขั้นตอนที่ 4 : กดปุ่มเพื่อบันทึกการเปลี่ยนแปลงหรือยกเลิก
                                        </td>                  
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="4" style="padding-top: 10px; padding-bottom: 15px;">
                                            <asp:Button ID="btnSave" runat="server" Text="บันทึกการเปลี่ยนแปลง" OnClick="btnSave_Click" />&nbsp&nbsp
                                            <asp:Button ID="btnCancel" runat="server" Text="ยกเลิก" OnClick="btnCancel_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </div>
        </div>
    </td>
    </tr>
    </table>    

</asp:Content>